Skip to content

chore: Adds internal style api v2 to item card - #5246

Merged
vvaliyev merged 1 commit into
mainfrom
style-v2-item-card
Nov 6, 2026
Merged

vvaliyev merged 1 commit into
mainfrom
style-v2-item-card

Conversation

@vvaliyev

@vvaliyev vvaliyev commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Description

Adds the internal Style API v2 to Item card: root, header (rendered when header, description, icon or actions is set) and footer. The default rendering of Item card and Cards does not change: every existing declaration keeps its value as the fallback, and the new header and footer corner radii and zero-width transparent divider borders paint nothing by default. v1 style and v2 styleClassNames are not meant to be combined on one instance; v1 behaviour is unchanged from main, with one fix: a v1 footer divider on a card that has only a footer now follows the card's rounded top corners instead of running straight through them.

The style-docs snapshot and the VR registration of the dev page follow in one PR for all components.

Tracker section: P3d34KdbCd6o.

Related links, issue #, if available: n/a

How has this been tested?

Unit tests for every slot, dev page item-card/style-api-v2, build and lint green.

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

ItemCard still applies the legacy border radius inline, overriding the v2 root radius and causing mismatched corners between the outline, background, and shadow.

1 open issue
What changed in this PR

Adds internal Style API v2 support to ItemCard, exposing root, header, and footer styling slots while preserving default rendering and legacy styling fallbacks.

Changes:

  • Adds slot class names and styling tokens for borders and corner radii.
  • Preserves legacy footer-divider behavior and adds unit coverage.
  • Adds a demo page showing combined and individual slot styling.
File Description
src/​item-card/​styles.scss Defines slot styling, token fallbacks, and section corner radii.
src/​item-card/​style.tsx Preserves legacy footer-divider defaults.
src/​item-card/​internal.tsx Applies internal styling classes to each slot.
src/​item-card/​__tests__/​styles.test.tsx Tests partially specified footer dividers.
src/​item-card/​__tests__/​style-api.test.tsx Tests slot classes, conditional rendering, and DOM prop filtering.
pages/​item-card/​style-api-v2.scss Defines demo styles for all three slots.
pages/​item-card/​style-api-v2.page.tsx Demonstrates slot styling across card variants.

Review effort: Balanced

Comment thread src/item-card/styles.scss Resolved
@codecov

codecov Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.82%. Comparing base (ab62434) to head (7d504bd).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5246      +/-   ##
==========================================
- Coverage   97.82%   97.82%   -0.01%     
==========================================
  Files        1006     1006              
  Lines       32621    32577      -44     
  Branches    12117    12103      -14     
==========================================
- Hits        31913    31868      -45     
- Misses        666      667       +1     
  Partials       42       42              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The border-radius change breaks published v1 API compatibility by misinterpreting or rejecting valid shorthand values, producing unintended elliptical or square corners.

2 open issues

Review effort: Balanced

Comment thread src/item-card/styles.scss Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Header and footer corner properties incorrectly receive the full border-radius shorthand, causing malformed or square corners that can let section backgrounds extend outside the rounded card.

2 open issues
1 resolved since last review

Review effort: Balanced

Comment thread src/item-card/styles.scss Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Header and footer backgrounds can extend beyond the card’s rounded boundary with percentage or large fixed radii, requiring a styling fix and browser regression coverage.

2 open issues
1 resolved since last review

Review effort: Balanced

Comment thread src/item-card/styles.scss Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the ItemCard Style API v2 changes.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

@vvaliyev
vvaliyev marked this pull request as ready for review November 5, 2026 13:26
@vvaliyev
vvaliyev requested a review from a team as a code owner November 5, 2026 13:26
@vvaliyev
vvaliyev requested review from pan-kot and removed request for a team November 5, 2026 13:26
Comment thread src/item-card/styles.scss Resolved
Comment thread src/item-card/styles.scss Resolved
@vvaliyev
vvaliyev added this pull request to the merge queue Nov 6, 2026
Merged via the queue into main with commit 8c00352 Nov 6, 2026
70 checks passed
@vvaliyev
vvaliyev deleted the style-v2-item-card branch November 6, 2026 14:58

This branch was successfully deployed

3 active deployments
dev-pages-react18 — 7d504bde Deployed Nov 5, 2026 by vvaliyev via deploy (React 18) / deploy #3197
dev-pages-react16 — 7d504bde Deployed Nov 5, 2026 by vvaliyev via deploy (React 16) / deploy #3197
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants